package com.infore.operation;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author:wk
 * @Date:Created in 8:41 2017\11\6 0006
 */
@Configuration
public class SimpleWebAppConfigurer extends WebMvcConfigurerAdapter {

    @Value("${photoPath}")
    private String  filePath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**").addResourceLocations("file:"+filePath+"/");
        super.addResourceHandlers(registry);
    }
}
